package gui2.g2;

import java.awt.Color;
import java.awt.Component;

import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.ListCellRenderer;

public class ChatListRenderer implements ListCellRenderer {

	@Override
	public Component getListCellRendererComponent(JList list, Object value,
			int index, boolean isSelected, boolean cellHasFocus) {
		JLabel l = new JLabel();
		l.setText(value.toString());
		l.setOpaque(true);
		l.setBackground(value.toString().startsWith("H") ? Color.RED
				: Color.BLUE);
		return l;
	}

}
